<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<title>登录</title>
		<%@include file="/common/header.jsp" %>			
		<link rel="stylesheet" href="${basePath }css/info.css"/>
	</head>
	<body>
		<%@include file="/common/top.jsp" %>		

		<div class="_loginFrame">
			<form action="${basePath }user_modifyPwd.action" method="POST" id="infoForm">
				
				<div class="_login">
					<div class="_login_title">
						<h2>个人信息</h2>
					</div>
					<div class="_login_text">
						<div class="_login_account_img_acc"></div>
						<div class="_login_account">
							<s:textfield name="user.account" readonly="true"></s:textfield>
						</div>
					</div>
					<div class="_login_text">
						<div class="_login_account_img_email"></div>
						<div class="_login_email">
							<s:textfield name="user.email" readonly="true"></s:textfield>
						</div>
					</div>
					<div class="_login_text">
						<div class="_login_account_img_phone"></div>
						<div class="_login_email">
							<s:textfield name="user.phone" readonly="true"></s:textfield>
						</div>
					</div>
					<div class="_login_title">
						<h2>修改密码<span style="color:red;">    ${requestScope.msg }</span></h2>
					</div>
					<div class="_login_text">
						<div class="_login_account_img_pwd"></div>
						<div class="_login_account">
							<s:password id="password" name="pwd"></s:password>							
						</div>
					</div>
					<div class="_login_text">
						<div class="_login_account_img_pwd"></div>
						<div class="_login_account">
							<s:password id="rpassword" name="rpwd"></s:password>	
						</div>
					</div>
					<div class="_login_btn">
						<input class="_login_btn_sub" type="button" value="确定修改" onclick="doSubmit()"/>
					</div>
					<div class="_login_register">
						<a href="javascript:showTip()">提示</a>
						<a href="${basePath}home/home_toHomePageUI.action">返回首页</a>
					</div>
				</div>
				
			</form>
		</div>
		
			<jsp:include page="/common/footer.jsp"></jsp:include>
		<script>
			function doSubmit(){
				
				var pwdinfo = $('#password').val();		
				if(pwdinfo.length < 4 || pwdinfo.length > 16){
					alert('旧密码输入错误');
					$('#password').focus();	
					return false;
				}
				
				var rpwdinfo = $('#rpassword').val();		
				if(rpwdinfo.length < 4 || rpwdinfo.length > 16){
					alert('新密码不能为空,并且长度为4-16个字符');
					$('#rpassword').focus();	
					return false;
				}
				
				//提交表单
				$("#infoForm").submit();
			}
			
			function showTip(){
				alert('只能修改密码,其他信息不可修改\n先填入旧密码,后新密码,旧密码正确后修改成功.');
			}
		</script>
	</body>
</html>